import { useTheme } from '../context/ThemeContext';

const ThemeToggle: React.FC = () => {
    const { theme, toggleTheme } = useTheme();

    return (
        <button
            onClick={toggleTheme}
            style={{
                position: 'fixed',
                top: '20px',
                right: '20px',
                padding: '10px',
                backgroundColor: theme === 'light' ? '#007bff' : '#343a40',
                color: 'white',
                border: 'none',
                borderRadius: '4px',
                cursor: 'pointer',
                zIndex: 1000,
            }}
        >
            {theme === 'light' ? '切换到暗色' : '切换到亮色'}
        </button>
    );
};

export default ThemeToggle; 